﻿//*****************************************************************************
// (C) Copyright 2010 Tiago Pascoal
// This code is licensed under the Microsoft Public License (Ms-PL) 
// [http://www.microsoft.com/opensource/licenses.mspx#Ms-PL].
//
//*****************************************************************************
using Microsoft.TeamFoundation.WorkItemTracking.Client;

namespace WorkItemVisualization.Controls.QueryEditorControl
{
    internal static class SortFieldListExtension
    {
        public static bool Contains(this SortFieldList sortFieldList,FieldDefinition fieldDefinition)
        {
            if (sortFieldList == null) return false;
            foreach (SortField sortField in sortFieldList)
            {
                if (sortField.FieldDefinition.ReferenceName == fieldDefinition.ReferenceName)
                    return true;
            }
            return false;
        }
    }
}
